tools: Fix some type issues GCC 4.1.0 warnings.
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Thu, 7 Jun 2007 10:02:23 +0000 (11:02 +0100)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Thu, 7 Jun 2007 10:02:23 +0000 (11:02 +0100)
FC5's gcc 4.1.0 can't make some files in tools/ due to its stronger
type checking.

From: Dexuan Cui <dexuan.cui@intel.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
tools/console/daemon/io.c
tools/ioemu/target-i386-dm/exec-dm.c

index 29090db506db2ae9bafff05287b788016c6acb1a..92c57ec605880bb7e6ce9d261a67fc3a14fb8ca1 100644 (file)
@@ -183,7 +183,8 @@ static int create_domain_log(struct domain *dom)
 {
        char logfile[PATH_MAX];
        char *namepath, *data, *s;
-       int fd, len;
+       int fd;
+       unsigned int len;
 
        namepath = xs_get_domain_path(xs, dom->domid);
        s = realloc(namepath, strlen(namepath) + 6);
index a45bef292508d39563f22f7b198cc9b2e01d175f..ca208b0839ebca024d801ef33392b47a363d9fd9 100644 (file)
@@ -448,18 +448,29 @@ extern unsigned long logdirty_bitmap_size;
 void memcpy_words(void *dst, void *src, size_t n)
 {
     while (n >= sizeof(long)) {
-        *((long *)dst)++ = *((long *)src)++;
+        *((long *)dst) = *((long *)src);
+        dst = ((long *)dst) + 1;
+        src = ((long *)src) + 1;
         n -= sizeof(long);
     }
 
-    if (n & 4)
-        *((uint32_t *)dst)++ = *((uint32_t *)src)++;
+    if (n & 4) {
+        *((uint32_t *)dst) = *((uint32_t *)src);
+        dst = ((uint32_t *)dst) + 1;
+        src = ((uint32_t *)src) + 1;
+   }
 
-    if (n & 2)
-        *((uint16_t *)dst)++ = *((uint16_t *)src)++;
+    if (n & 2) {
+        *((uint16_t *)dst) = *((uint16_t *)src);
+        dst = ((uint16_t *)dst) + 1;
+        src = ((uint16_t *)src) + 1;
+    }
 
-    if (n & 1)
-        *((uint8_t *)dst)++ = *((uint8_t *)src)++;
+    if (n & 1) {
+        *((uint8_t *)dst) = *((uint8_t *)src);
+        dst = ((uint8_t *)dst) + 1;
+        src = ((uint8_t *)src) + 1;
+    }
 }
 
 void cpu_physical_memory_rw(target_phys_addr_t addr, uint8_t *buf,